package cn.skyclass.events
{
	import cn.skyclass.beans.ITreeNode;
	
	import flash.events.Event;
	
	import mx.collections.ArrayCollection;
	
	/**
	 * 树节点事件
	 */
	public class TreeNodeEvent extends Event
	{
		public static const SELECT_NODE:String = "selectNode";
		public static const SELECT_NODES:String = "selectNodes";
		
		// 节点自身的内容被加载或是发生改变
		public static const CONTENT_LOADED:String = "contentLoaded";
		public static const CONTENT_CHANGED:String = "contentChanged";
		
		// 节点的子节点被加载或是发生改变
		public static const CHILDREN_LOADED:String = "childrenLoaded";
		public static const CHILDREN_CHANGED:String = "childrenChanged";

		
		public var node:ITreeNode;
		public var nodes:ArrayCollection = new ArrayCollection();
		
		
		public function TreeNodeEvent(type:String, node:ITreeNode=null){
			super(type);
			this.node = node;
		}
		
		override public function clone():Event{
			var e:TreeNodeEvent = new TreeNodeEvent(this.type, this.node);
			e.nodes = this.nodes;
			return e;
		}				
	}
}